package pers.ascend.spring.cloud.greenwich.service.governance.nacos.producer.manage.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
 * 说明：
 *
 * @author ascend
 * 2021/3/15 17:09
 */
@RestController
@RequestMapping(value = "/producer")
@Validated
public class NacosProducerController {
    protected Logger log = LoggerFactory.getLogger(getClass());

    @GetMapping(value = "/hello")
    public String hello(@RequestParam("name") @NotNull String name) {
        if (log.isInfoEnabled()) {
            log.info("NacosProducerController.hello({})", name);
        }
        return "hello " + name;
    }
}
